// flower/flower.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currtab: 0,
    swipertab: [{
      name: '婚纱礼服',
      index: 0
    }, {
      name: '新娘捧花',
      index: 1
    }, {
      name: '婚礼地点',
      index: 2
    }, {
      name: '婚礼甜品',
      index: 3
    }, {
      name: '主题婚礼',
      index: 4
    }],
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    // 页面渲染完成
    this.getDeviceInfo()
    this.orderShow()
  },

  getDeviceInfo: function() {
    let that = this
    wx.getSystemInfo({
      success: function(res) {
        that.setData({
          deviceW: res.windowWidth,
          deviceH: res.windowHeight
        })
      }
    })
  },

  /**
   * @Explain：选项卡点击切换
   */
  tabSwitch: function(e) {
    var that = this
    if (this.data.currtab === e.target.dataset.current) {
      return false
    } else {
      that.setData({
        currtab: e.target.dataset.current
      })
    }
  },

  tabChange: function(e) {
    this.setData({
      currtab: e.detail.current
    })
    this.orderShow()
  },

  orderShow: function() {
    let that = this
    switch (this.data.currtab) {
      case 0:
        that.weedingShow()
        break
      case 1:
        that.flowerShow()
        break
      case 2:
        that.placeShow()
      case 3:
        that.sweetShow()
      case 4:
        that.themeShow()
        break
    }
  },
  weedingShow: function() {
    this.setData({
      weedingOrder: [{
        url: "http://luofengmei.work:8080/image/婚纱/h12.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h5.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h3.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h4.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h13.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h7.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h8.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h9.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h2.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h6.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h11.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h14.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }]
    })
  },

  flowerShow: function() {
    this.setData({
      flowerOrder: [{
        url: "http://luofengmei.work:8080/image/捧花/p11.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p14.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p3.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p12.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p4.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p5.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p10.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p15.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p9.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p2.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p13.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p6.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p8.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/捧花/p7.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }]
    })
  },

  placeShow: function() {
    this.setData({
      placeOrder: [{
        url: "http://luofengmei.work:8080/image/目的地/m9.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m10.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m8.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m7.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m6.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m5.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m4.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m3.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m2.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/目的地/m1.jpg",
        title: "最美的惊喜",
        remark: "M.JOY Bride"
      }]
    })
  },

  sweetShow: function() {
    this.setData({
      sweetOrder: [{
        url: "http://luofengmei.work:8080/image/甜品/t1.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
          url: "http://luofengmei.work:8080/image/甜品/t2.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
        }, {
          url: "http://luofengmei.work:8080/image/甜品/t3.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
        }, {
          url: "http://luofengmei.work:8080/image/甜品/t4.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }]
    })
  },

  themeShow: function() {
    this.setData({
      themeOrder: [{
        url: "http://luofengmei.work:8080/image/婚纱/h12.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h11.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h2.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }, {
        url: "http://luofengmei.work:8080/image/婚纱/h10.jpg",
        title: "北欧控·第二季",
        remark: "M.JOY Bride"
      }]
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})